Optimal. Leaf size=156 \[ \frac {a x}{c^2 d}+\frac {i b x}{2 c^2 d}-\frac {i b \text {ArcTan}(c x)}{2 c^3 d}+\frac {b x \text {ArcTan}(c x)}{c^2 d}-\frac {i x^2 (a+b \text {ArcTan}(c x))}{2 c d}-\frac {i (a+b \text {ArcTan}(c x)) \log \left (\frac {2}{1+i c x}\right )}{c^3 d}-\frac {b \log \left (1+c^2 x^2\right )}{2 c^3 d}+\frac {b \text {PolyLog}\left (2,1-\frac {2}{1+i c x}\right )}{2 c^3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.13, antiderivative size = 156, normalized size of antiderivative = 1.00, number of steps
used = 11, number of rules used = 9, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.391, Rules used = {4986, 4946,
327, 209, 4930, 266, 4964, 2449, 2352} \begin {gather*} -\frac {i \log \left (\frac {2}{1+i c x}\right ) (a+b \text {ArcTan}(c x))}{c^3 d}-\frac {i x^2 (a+b \text {ArcTan}(c x))}{2 c d}+\frac {a x}{c^2 d}-\frac {i b \text {ArcTan}(c x)}{2 c^3 d}+\frac {b x \text {ArcTan}(c x)}{c^2 d}+\frac {b \text {Li}_2\left (1-\frac {2}{i c x+1}\right )}{2 c^3 d}+\frac {i b x}{2 c^2 d}-\frac {b \log \left (c^2 x^2+1\right )}{2 c^3 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 266
Rule 327
Rule 2352
Rule 2449
Rule 4930
Rule 4946
Rule 4964
Rule 4986
Rubi steps
\begin {align*} \int \frac {x^2 \left (a+b \tan ^{-1}(c x)\right )}{d+i c d x} \, dx &=\frac {i \int \frac {x \left (a+b \tan ^{-1}(c x)\right )}{d+i c d x} \, dx}{c}-\frac {i \int x \left (a+b \tan ^{-1}(c x)\right ) \, dx}{c d}\\ &=-\frac {i x^2 \left (a+b \tan ^{-1}(c x)\right )}{2 c d}-\frac {\int \frac {a+b \tan ^{-1}(c x)}{d+i c d x} \, dx}{c^2}+\frac {(i b) \int \frac {x^2}{1+c^2 x^2} \, dx}{2 d}+\frac {\int \left (a+b \tan ^{-1}(c x)\right ) \, dx}{c^2 d}\\ &=\frac {a x}{c^2 d}+\frac {i b x}{2 c^2 d}-\frac {i x^2 \left (a+b \tan ^{-1}(c x)\right )}{2 c d}-\frac {i \left (a+b \tan ^{-1}(c x)\right ) \log \left (\frac {2}{1+i c x}\right )}{c^3 d}-\frac {(i b) \int \frac {1}{1+c^2 x^2} \, dx}{2 c^2 d}+\frac {(i b) \int \frac {\log \left (\frac {2}{1+i c x}\right )}{1+c^2 x^2} \, dx}{c^2 d}+\frac {b \int \tan ^{-1}(c x) \, dx}{c^2 d}\\ &=\frac {a x}{c^2 d}+\frac {i b x}{2 c^2 d}-\frac {i b \tan ^{-1}(c x)}{2 c^3 d}+\frac {b x \tan ^{-1}(c x)}{c^2 d}-\frac {i x^2 \left (a+b \tan ^{-1}(c x)\right )}{2 c d}-\frac {i \left (a+b \tan ^{-1}(c x)\right ) \log \left (\frac {2}{1+i c x}\right )}{c^3 d}+\frac {b \text {Subst}\left (\int \frac {\log (2 x)}{1-2 x} \, dx,x,\frac {1}{1+i c x}\right )}{c^3 d}-\frac {b \int \frac {x}{1+c^2 x^2} \, dx}{c d}\\ &=\frac {a x}{c^2 d}+\frac {i b x}{2 c^2 d}-\frac {i b \tan ^{-1}(c x)}{2 c^3 d}+\frac {b x \tan ^{-1}(c x)}{c^2 d}-\frac {i x^2 \left (a+b \tan ^{-1}(c x)\right )}{2 c d}-\frac {i \left (a+b \tan ^{-1}(c x)\right ) \log \left (\frac {2}{1+i c x}\right )}{c^3 d}-\frac {b \log \left (1+c^2 x^2\right )}{2 c^3 d}+\frac {b \text {Li}_2\left (1-\frac {2}{1+i c x}\right )}{2 c^3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.12, size = 132, normalized size = 0.85 \begin {gather*} -\frac {-2 a c x-i b c x+i a c^2 x^2+2 b \text {ArcTan}(c x)^2+i \text {ArcTan}(c x) \left (-2 i a+b+2 i b c x+b c^2 x^2+2 b \log \left (1+e^{2 i \text {ArcTan}(c x)}\right )\right )-i a \log \left (1+c^2 x^2\right )+b \log \left (1+c^2 x^2\right )+b \text {PolyLog}\left (2,-e^{2 i \text {ArcTan}(c x)}\right )}{2 c^3 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.10, size = 267, normalized size = 1.71
method | result | size |
derivativedivides | \(\frac {\frac {a c x}{d}+\frac {i b \arctan \left (c x \right ) \ln \left (c x -i\right )}{d}+\frac {i b c x}{2 d}-\frac {a \arctan \left (c x \right )}{d}+\frac {b \arctan \left (c x \right ) c x}{d}+\frac {i b \arctan \left (\frac {c x}{2}-\frac {i}{2}\right )}{4 d}+\frac {i b \arctan \left (\frac {1}{6} c^{3} x^{3}+\frac {7}{6} c x \right )}{8 d}-\frac {b \ln \left (c x -i\right )^{2}}{4 d}+\frac {b \ln \left (c x -i\right ) \ln \left (-\frac {i \left (c x +i\right )}{2}\right )}{2 d}+\frac {b \dilog \left (-\frac {i \left (c x +i\right )}{2}\right )}{2 d}+\frac {b}{2 d}-\frac {i b \arctan \left (\frac {c x}{2}\right )}{8 d}-\frac {3 b \ln \left (c^{2} x^{2}+1\right )}{8 d}+\frac {i a \ln \left (c^{2} x^{2}+1\right )}{2 d}-\frac {b \ln \left (c^{4} x^{4}+10 c^{2} x^{2}+9\right )}{16 d}-\frac {i b \arctan \left (c x \right ) c^{2} x^{2}}{2 d}-\frac {i a \,c^{2} x^{2}}{2 d}-\frac {3 i b \arctan \left (c x \right )}{4 d}}{c^{3}}\) | \(267\) |
default | \(\frac {\frac {a c x}{d}+\frac {i b \arctan \left (c x \right ) \ln \left (c x -i\right )}{d}+\frac {i b c x}{2 d}-\frac {a \arctan \left (c x \right )}{d}+\frac {b \arctan \left (c x \right ) c x}{d}+\frac {i b \arctan \left (\frac {c x}{2}-\frac {i}{2}\right )}{4 d}+\frac {i b \arctan \left (\frac {1}{6} c^{3} x^{3}+\frac {7}{6} c x \right )}{8 d}-\frac {b \ln \left (c x -i\right )^{2}}{4 d}+\frac {b \ln \left (c x -i\right ) \ln \left (-\frac {i \left (c x +i\right )}{2}\right )}{2 d}+\frac {b \dilog \left (-\frac {i \left (c x +i\right )}{2}\right )}{2 d}+\frac {b}{2 d}-\frac {i b \arctan \left (\frac {c x}{2}\right )}{8 d}-\frac {3 b \ln \left (c^{2} x^{2}+1\right )}{8 d}+\frac {i a \ln \left (c^{2} x^{2}+1\right )}{2 d}-\frac {b \ln \left (c^{4} x^{4}+10 c^{2} x^{2}+9\right )}{16 d}-\frac {i b \arctan \left (c x \right ) c^{2} x^{2}}{2 d}-\frac {i a \,c^{2} x^{2}}{2 d}-\frac {3 i b \arctan \left (c x \right )}{4 d}}{c^{3}}\) | \(267\) |
risch | \(\frac {b \ln \left (i c x +1\right )^{2}}{4 c^{3} d}-\frac {b \left (\frac {1}{2} c \,x^{2}+i x \right ) \ln \left (i c x +1\right )}{2 c^{2} d}-\frac {i x^{2} a}{2 d c}+\frac {a x}{c^{2} d}+\frac {i a}{2 d \,c^{3}}-\frac {i b \arctan \left (c x \right )}{2 c^{3} d}-\frac {a \arctan \left (c x \right )}{d \,c^{3}}+\frac {\ln \left (-i c x +1\right ) x^{2} b}{4 d c}+\frac {i b x}{2 c^{2} d}-\frac {b \ln \left (c^{2} x^{2}+1\right )}{2 c^{3} d}+\frac {i \ln \left (-i c x +1\right ) x b}{2 d \,c^{2}}+\frac {i a \ln \left (c^{2} x^{2}+1\right )}{2 d \,c^{3}}+\frac {b}{8 c^{3} d}+\frac {b \ln \left (\frac {1}{2}+\frac {i c x}{2}\right ) \ln \left (\frac {1}{2}-\frac {i c x}{2}\right )}{2 d \,c^{3}}-\frac {b \ln \left (\frac {1}{2}+\frac {i c x}{2}\right ) \ln \left (-i c x +1\right )}{2 d \,c^{3}}+\frac {b \dilog \left (\frac {1}{2}-\frac {i c x}{2}\right )}{2 d \,c^{3}}\) | \(273\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - \frac {i \left (\int \frac {2 b \log {\left (i c x + 1 \right )}}{c^{2} x^{2} + 1}\, dx + \int \frac {4 a c^{3} x^{3}}{c^{2} x^{2} + 1}\, dx + \int \frac {b c^{2} x^{2}}{c^{2} x^{2} + 1}\, dx + \int \frac {4 i a c^{2} x^{2}}{c^{2} x^{2} + 1}\, dx + \int \left (- \frac {2 i b c x}{c^{2} x^{2} + 1}\right )\, dx + \int \left (- \frac {i b c^{3} x^{3}}{c^{2} x^{2} + 1}\right )\, dx + \int \frac {2 b c^{2} x^{2} \log {\left (i c x + 1 \right )}}{c^{2} x^{2} + 1}\, dx + \int \frac {2 i b c x \log {\left (i c x + 1 \right )}}{c^{2} x^{2} + 1}\, dx + \int \left (- \frac {2 i b c^{3} x^{3} \log {\left (i c x + 1 \right )}}{c^{2} x^{2} + 1}\right )\, dx\right )}{4 c^{2} d} + \frac {\left (b c^{2} x^{2} + 2 i b c x - 2 b \log {\left (i c x + 1 \right )}\right ) \log {\left (- i c x + 1 \right )}}{4 c^{3} d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {x^2\,\left (a+b\,\mathrm {atan}\left (c\,x\right )\right )}{d+c\,d\,x\,1{}\mathrm {i}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________